package com.vodafone.mapreduce.dto.framework;

import java.io.Serializable;
import java.util.Collections;
import java.util.List;

import com.vodafone.mapreduce.MapReduce;
import com.vodafone.mapreduce.dto.common.KeyValuePair;

/**
 * Generic and immutable DTO to store the input of the MapReduce process as a whole (in what ever way).
 * 
 * @param <K>
 * @param <V>
 */
public class MapReduceInput<K, V> implements Serializable {

    // -------------------------------------------------------------------------------------------------------------------------------------
    // Class constants.
    // -------------------------------------------------------------------------------------------------------------------------------------

    private static final long serialVersionUID = MapReduce.SERIAL_VERSION_UID;

    // -------------------------------------------------------------------------------------------------------------------------------------
    // Instance attributes.
    // -------------------------------------------------------------------------------------------------------------------------------------

    private final List<KeyValuePair<K, V>> kvStar;

    // -------------------------------------------------------------------------------------------------------------------------------------
    // Instance constructors.
    // -------------------------------------------------------------------------------------------------------------------------------------

    public MapReduceInput(List<KeyValuePair<K, V>> kvStar) {
        this.kvStar = kvStar;
    }

    // -------------------------------------------------------------------------------------------------------------------------------------
    // Instance methods.
    // -------------------------------------------------------------------------------------------------------------------------------------

    public List<KeyValuePair<K, V>> getKvStar() {
        return Collections.unmodifiableList(kvStar);
    }

    // -------------------------------------------------------------------------------------------------------------------------------------

}
